import i18n from '@/lang';
import { Message } from 'element-ui';
import { debounce } from "lodash";

export default class CommonErrorStatus {
  public 401 = debounce((res: any) => {
    location.href = "/login";
    Message.warning(i18n.t("common.service_error_status.401").toString());
  });

  public 504 = debounce(() => {
    Message.warning(i18n.t("common.service_error_status.504").toString());
  });

  public 500 = debounce(() => {
    Message.warning(i18n.t("common.service_error_status.500").toString());
  });

  public default = debounce(() => {
    Message.warning(i18n.t("common.service_error_status.default").toString());
  });
}